package com.itheima.demo01.File;

import java.io.File;

public class Demo04File {
    public static void main(String[] args) {
//        show01();
        show02();
    }

    public static void show01() {
        File f1 = new File("D:\\Java-Code\\day08_FileAndRecursion");
        System.out.println(f1.exists());
        File f2 = new File("D:\\Java-Code\\day08_FileAndRecursion\\shuang");
        System.out.println(f2.exists());
        File f3 = new File("day08_FileAndRecursion\\day08_FileAndRecursion.iml");
        System.out.println(f3.exists());
    }

    public static void show02() {
        File f1 = new File("D:\\Java-Code\\day08_FileAndRecursion\\shuang");
        if (f1.exists()) {
            System.out.println(f1.isDirectory());
            System.out.println(f1.isFile());
        }
        File f2 = new File("day08_FileAndRecursion\\day08_FileAndRecursion.iml");
        if (f2.exists()) {
            System.out.println(f2.isDirectory());
            System.out.println(f2.isFile());
        }
        File f3 = new File("day08_FileAndRecursion");
        if (f3.exists()) {
            System.out.println(f3.isDirectory());
            System.out.println(f3.isFile());
        }
    }
}
